From 37541c41651ee9b29ffeda3870cb3ba704d7e756 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 7 Aug 2009 17:31:27 +0100 Subject: [PATCH] tools: Fix iptables failure test in vif-common.sh In changset 19540 a bug was introduced in the fib_iptable function in vif-common.sh that incorrectly checks the exit status of iptables -- it always believes iptables has failed even when it hasn't. The attached patch fixes that. It's also bug 1490. Signed-off-by: John Haxby --- tools/hotplug/Linux/vif-common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hotplug/Linux/vif-common.sh b/tools/hotplug/Linux/vif-common.sh index fe483f9dc9..44dd342acf 100644 --- a/tools/hotplug/Linux/vif-common.sh +++ b/tools/hotplug/Linux/vif-common.sh @@ -78,7 +78,7 @@ frob_iptable() iptables "$c" FORWARD -m state --state RELATED,ESTABLISHED -m physdev \ --physdev-out "$vif" -j ACCEPT 2>/dev/null - if [ "$command" == "online" ] && [ $? ] + if [ "$command" == "online" -a $? -ne 0 ] then log err "iptables setup failed. This may affect guest networking." fi -- 2.30.2